Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jmx monitoring for enforcer #3067

Merged
merged 20 commits into from
Oct 21, 2022
Merged

Conversation

Amila-Rukshan
Copy link
Contributor

@Amila-Rukshan Amila-Rukshan commented Sep 9, 2022

Purpose

To enable jmx monitoring for enforcer.

Fixes #3076

JConsole Agent

  1. Add following section to your JAVA_OPTS property:
export JAVA_OPTS="-Dchoreo.connect.jmx.metrics.enabled=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.rmi.port=9999 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=0.0.0.0"
  1. Add port mapping to enforcer:
  enforcer:
    ...
    ports:
     ...
      - "9999:9999"
      - "11111:11111"
  1. Run jconsole(in your java home /bin directory) and connect to localhost:11111 or service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi.

Jolokia Agent

  1. Download Jolokia JVM-Agent from here. For example downloaded jar name is jolokia-jvm-1.7.1.jar

  2. Add the above jar to the enforcer droppings location.

  3. Add following section to your JAVA_OPTS property (Use the exact name of the jar you added to the droppings replacing jolokia-jvm-1.7.1.jar):

export JAVA_OPTS="-Dchoreo.connect.jmx.metrics.enabled=true -javaagent:/home/wso2/lib/dropins/jolokia-jvm-1.7.1.jar=port=7777,host=0.0.0.0"
  1. Add port mapping to enforcer:
  enforcer:
    ...
    ports:
     ...
      - "7777:7777"
  1. Try following URLs in the browser:

View ext auth service thread pool config
http://localhost:7777/jolokia/read/org.wso2.choreo.connect.enforcer:type=ThreadPoolConfig

View ext auth service metrics
http://localhost:7777/jolokia/read/org.wso2.choreo.connect.enforcer:type=ExtAuthMetrics

Reset ext auth service metrics record
http://localhost:7777/jolokia/exec/org.wso2.choreo.connect.enforcer:type=ExtAuthMetrics/resetExtAuthMetrics

Automation tests

Tested environments

OS: Darwin
Env: Docker


Maintainers: Check before merge

  • Assigned 'Type' label
  • Assigned the project
  • Validated respective github issues
  • Assigned milestone to the github issue(s)

Copy link
Contributor

@VajiraPrabuddhaka VajiraPrabuddhaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments regarding logging.

pubudu538
pubudu538 previously approved these changes Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve JMX monitoring for Enforcer
5 participants